function prefix(obj,namespace){
  return Object.keys(obj).reduce((memo,key)=>{
    //如果model里的可以是add, 模块名叫counter1, 那么这里就要把key改为 counter1/add
    const newKey = `${namespace}/${key}`;
    memo[newKey] = obj[key];
    return memo;
  },{})
}

function prefixNamespace(model){
  if (model.reducers) {
    model.reducers = prefix(model.reducers, model.namespace);
  }
  return model;
}

export default prefixNamespace;
